<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>myEachrts</title>
    <style>
      .container {
        width: 800px;
        height: 400px;
      }
    </style>
  </head>
  <body>
    <!-- DOM 容器  -->
    <div class="container"></div>
    <!--引js文件-->
    <script src="./js/echarts.min.js"></script>

    <script>
      /* 初始化实例 */
      const myEachrts = echarts.init(document.querySelector(".container"));
      /* 定义图表选项 */
      const option = {
        // 标题
        title: {
          text: "ECharts 入门示例",
          left: "center",
        },
        // x轴
        xAxis: {
          data: [
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六",
            "星期日",
          ],
        },
        yAxis: {},
        series: {
          data: [20, 30, 50, 150, 44, 63, 77],
          type: "bar",
        },
      };
      /*  渲染图表 */
      myEachrts.setOption(option);
    </script>
  </body>
</html>
